package Collection;

import org.junit.Test;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedList;

public class Collectiondemo1 {
    @Test
    public void method1(){
        Collection<String > collection1=new ArrayList<>();
        collection1.add("hello");
        collection1.add("java");
//        Iterator<String> iterator = collection1.iterator();
//        System.out.println(collection1);
//        while (iterator.hasNext()){
//            String temp=iterator.next();
//            System.out.println(temp);
//        }
        for (String  a:collection1) {
            System.out.println(a);
        }
        LinkedList linkedList = new LinkedList();
    }
}
